1. Field of the Invention
The present invention relates to an image reading apparatus for reading an image of a document, and more particularly, it relates to the generation of reference data upon reading the image of the document.
2. Description of the Related Art
In an image reading apparatus for reading images of documents, there has been known one which is capable of performing manual reading in which the image of a document placed on a document glass is read by driving an optical reading system to move in a predetermined direction, and ADF reading (so-called flow reading) in which the image of a moving document is read by an optical reading system that is stopped at a predetermined position.
In the past, in the image reading apparatus as stated above, there has been disclosed a technique in which when the image of a document can not be correctly read due to dust, smudge, etc., adhered between the document glass and the document or to a lower portion of the document glass at the time of ADF reading, the optical reading system is moved to a position in which dust, smudge or the like is not adhered, so that the image of the document can be accurately read (see Japanese patent application laid-open No. 2002-185726 and Japanese patent application laid-open No. 2002-250977). The above-mentioned prior art is to avoid the occurrence of abnormality in image reading processing when a smudge or the like is adhered to the document glass at the time of ADF reading.
In addition, there has also been known a technique in which when dust, smudge or the like is adhered to a white reference plate that is used for shading compensation, defective pixels are detected by comparing, pixel by pixel, the value indicative of the gray level of an image signal when the white reference plate is read with a predetermined specified value, and if the number of continuous defective pixels concerned is more than or equal to a predetermined specified number of continuous pixels, it is determined that abnormality has occurred. In this prior art, the white reference plate is read in different line positions a plurality of times, and an abnormality determination is made based on an image signal obtained when reading the white reference plate in a line position with the least number of defective pixels, and when the presence of abnormality is not determined in the abnormality determination, a document is read in a line position with the least number of defective pixels, so that the influence on shading compensation can be reduced even if a smudge adheres to the white reference plate (Japanese patent application laid-open No. 2004-222180). In the above-mentioned prior art, if the presence of abnormality is not determined in the abnormality determination, shading compensation will be made with reference data including defective pixels even though the number thereof is small, so the document image can not be necessarily correctly read.
Moreover, in the prior art as stated above, no particular distinction is made between a region of the white reference plate to be read by the optical reading system when shading compensation is performed upon manual reading and a region of the white reference plate to be read by the optical reading system when shading compensation is performed upon ADF reading. Accordingly, it is general to read the same region on the white reference plate in both the cases when shading compensation is made upon manual reading and when shading compensation is made upon ADF reading, so in case where a smudge or the like concentrates around the region concerned, an influence will reach into both the shading compensation upon manual reading and the shading compensation upon ADF reading. Thus, it is undesirable from the viewpoints of image quality maintenance and processing efficiency that a smudge adhering to a certain region of the white reference plate or the document glass influences the shading compensation in both of these reading methods.
The present invention is intended to obviate the problems as referred to above, and has for its object to provide a technique that, when shading compensation is performed in an image reading apparatus, is less prone to be influenced by a smudge or the like adhered to a document glass or a white reference plate to be read by an optical reading system, and hence is able to contribute to an improvement in the quality of read images.